|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnegotiator.utility.EvaluatorDiscrete
public class EvaluatorDiscrete
This class is used to convert the value of a discrete issue to a utility. This object stores a mapping from each discrete value to a positive integer, the evaluation of the value. When asked for the utility of a value, the evaluation of the value is divided by the highest evaluation in the map. Note that this utility is not yet multiplied by the weight of the issue and therefore in the range [0,1].
| Constructor Summary | |
|---|---|
EvaluatorDiscrete()
Creates a new discrete evaluator with weight 0 and no values. |
|
| Method Summary | |
|---|---|
void |
addEvaluation(ValueDiscrete value,
java.lang.Integer evaluation)
Add a new possible value to the issue. |
void |
clear()
wipe evaluation values. |
EvaluatorDiscrete |
clone()
|
boolean |
equals(java.lang.Object obj)
|
java.lang.Integer |
getEvalMax()
|
java.lang.Double |
getEvaluation(UtilitySpace uspace,
Bid bid,
int issueID)
Returns the evaluation of the value of the issue of the bid. |
java.lang.Double |
getEvaluation(ValueDiscrete value)
|
java.lang.Integer |
getEvaluationNotNormalized(Bid bid,
int ID)
|
java.lang.Integer |
getEvaluationNotNormalized(ValueDiscrete value)
|
Value |
getMaxValue()
|
Value |
getMinValue()
|
EVALUATORTYPE |
getType()
|
java.lang.Integer |
getValue(ValueDiscrete value)
|
java.util.Set<ValueDiscrete> |
getValues()
|
double |
getWeight()
|
int |
hashCode()
|
java.lang.String |
isComplete(Objective whichobj)
Check whether the evaluator has enough information to make an evaluation. |
void |
loadFromXML(SimpleElement pRoot)
Method to |
void |
lockWeight()
Locks the weight of this Evaluator. |
java.lang.Double |
normalize(java.lang.Integer EvalValueL)
|
void |
setEvaluation(Value val,
int evaluation)
Sets the evaluation for Value val. |
void |
setWeight(double wt)
Sets the weigth with which an Objective or Issue is evaluated. |
SimpleElement |
setXML(SimpleElement evalObj)
Sets weights and evaluator properties for the object in SimpleElement representation that is passed to it. |
java.lang.String |
toString()
|
void |
unlockWeight()
Unlock the weight of this evaluator. |
boolean |
weightLocked()
|
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public EvaluatorDiscrete()
| Method Detail |
|---|
public double getWeight()
getWeight in interface Evaluatorpublic void setWeight(double wt)
Evaluator
setWeight in interface Evaluatorwt - The new weight.public void lockWeight()
lockWeight in interface Evaluatorpublic void unlockWeight()
unlockWeight in interface Evaluatorpublic boolean weightLocked()
weightLocked in interface Evaluatorpublic java.lang.Integer getValue(ValueDiscrete value)
value - of which the evaluation is requested.
public java.lang.Integer getEvalMax()
throws java.lang.Exception
java.lang.Exception - if there are no alternatives.
public java.lang.Double getEvaluation(UtilitySpace uspace,
Bid bid,
int issueID)
throws java.lang.Exception
getEvaluation in interface Evaluatoruspace - preference profile.bid - of which we want a value evaluated.issueID - unique id of the issue of which we want the evaluation.
java.lang.Exception - if problem, for instance illegal evaluation values.
public java.lang.Double getEvaluation(ValueDiscrete value)
throws java.lang.Exception
value - of the issue.
java.lang.Exception - if value is null.
public java.lang.Integer getEvaluationNotNormalized(Bid bid,
int ID)
throws java.lang.Exception
bid - ID - of the issue of which we are interested in the value
java.lang.Exception - if bid or value is null.
public java.lang.Integer getEvaluationNotNormalized(ValueDiscrete value)
throws java.lang.Exception
value - of the issue.
java.lang.Exception - if value is null.
public java.lang.Double normalize(java.lang.Integer EvalValueL)
throws java.lang.Exception
EvalValueL -
java.lang.Exception - if no evaluators or illegal values in evaluator.
ASSUMED that Max value is at least 1, becaues EVERY evaluatordiscrete is at least 1.public EVALUATORTYPE getType()
getType in interface Evaluator
public void setEvaluation(Value val,
int evaluation)
throws java.lang.Exception
val. If this value doesn't exist yet in this Evaluator,
adds it as well.
val - The value to add or have its evaluation modified.evaluation - The new evaluation.
java.lang.Exception - if evaluationpublic void clear()
public void loadFromXML(SimpleElement pRoot)
Evaluator
loadFromXML in interface Evaluatorpublic SimpleElement setXML(SimpleElement evalObj)
evalObj - The object of which to set the evaluation properties.
public java.lang.String isComplete(Objective whichobj)
Evaluator
isComplete in interface Evaluatorwhichobj - is the objective/issue to which this evaluator is attached.
public void addEvaluation(ValueDiscrete value,
java.lang.Integer evaluation)
value - to be added to the issue.evaluation - of the value.public Value getMaxValue()
public Value getMinValue()
public EvaluatorDiscrete clone()
clone in interface Evaluatorclone in class java.lang.Objectpublic java.util.Set<ValueDiscrete> getValues()
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||